package com.Ling.Thread.sync;

/**
 * File Name: ThreadDemo
 * Date: 2020-06-29 15:21
 * Author: liangling
 * Description 使用Thread实现多线程
 */
public class ThreadDemo extends  Thread{

    //多线程需要执行的业务代码
    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName()+"这是子线程");
    }

    public static void main(String[] args) {
        System.out.println(Thread.currentThread().getName()+"这是主线程");
        ThreadDemo thread = new ThreadDemo();
        thread.start();
    }
}
